<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ page import="com.ionglobal.cms.*" %>

<%@ include file="../init_include.jsp" %>

<%
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","000000100"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}
	
	Sysop sysop=(Sysop)session.getAttribute("sysop");

	
		
	int catid=0;
	String curpath="";
	try {	
		if(request.getParameter("catid")!=null) {
			catid=Integer.parseInt(request.getParameter("catid"));		
		}			
	} catch (NumberFormatException e) {
		out.println(e);
		return ;
	}

	String title="",subtitle="",author="",source="",content="";	
	String link="",pic="",keyword="";	
	int ordernum=0,classes=0;
	boolean hot=false;
	
	CategoryInfo cinfo=new CategoryInfo("cms",catid);	
	String ArchiveItem[]=cinfo.getNewName();	
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="../css.css" type="text/css">
<script Language="JavaScript" src="../script/Ion_Show.js"></script> 
<script language="JavaScript1.2">
  function checkForm(){
    var sForm=document.formIon;
		whereClause="";
		if(sForm.archive_title.value!="")
			whereClause+=" and title like '%"+sForm.archive_title.value+"%'";
		if(sForm.archive_subtitle.value!="")
			whereClause+=" and subtitle like '%"+sForm.archive_subtitle.value+"%'";
		if(sForm.archive_author.value!="")
			whereClause+=" and author like '%"+sForm.archive_author.value+"%'";
		if(sForm.archive_source.value!="")
			whereClause+=" and source like '%"+sForm.archive_source.value+"%'";
		if(sForm.archive_cruser.value!="")
			whereClause+=" and cruser like '%"+sForm.archive_cruser.value+"%'";
		if(sForm.archive_hot.value!="-1")
			whereClause+=" and hot="+sForm.archive_hot.value;
		if(sForm.archive_class.value!="-1")
			whereClause+=" and status="+sForm.archive_class.value;
		whereClause+=" ";
		whereClause=whereClause.substring(4);
		setWhereClause(whereClause);
		closewindow(0);			
		close();  
	} 
 
</script>
<title><%=ArchiveItem[0]%>  <%=Language.getNameByCode("cms.search","Search")%></title>
</head>
<body>
<%=Language.getNameByCode("sys.CurrentPos","Current Position")%>:<%=ArchiveItem[0]%> <%=Language.getNameByCode("cms.search","search")%><br> 
<hr>   
 <table width="100%" border="0" cellspacing="1" cellpadding="2" class="input_title">
   <tr>
     <td>&nbsp;<%=ArchiveItem[0]%> <%=Language.getNameByCode("cms.search","search")%></td>
   </tr>
 </table>
	 <form method="post" name="formIon" action="archive_search.jsp" onSubmit="return checkForm();">
   <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#666666">
   <% if(ArchiveItem[1]!=null && ArchiveItem[1].length()>0) {%>	 
   <tr class="bgcolor_title_tr"> 
     <td width="80" class="input_title" align="right">&nbsp;<%=ArchiveItem[1]%>: </td>
     <td> 
       <input type="text" name="archive_title" maxlength="255" size="46" value="<%=title%>">
     </td>
   </tr>
   <%}%>
   <% if(ArchiveItem[2]!=null && ArchiveItem[2].length()>0) {%>   
   <tr class="bgcolor_title_tr"> 
     <td class="input_title" align="right">&nbsp;<%=ArchiveItem[2]%>: </td>
     <td> 
       <input type="text" name="archive_subtitle" maxlength="255" size="46" value="<%=subtitle%>">
     </td>
   </tr>
   <%}%>
   <% if(ArchiveItem[4]!=null && ArchiveItem[4].length()>0) {%>   
   <tr class="bgcolor_title_tr"> 
     <td class="input_title" align="right">&nbsp;<%=ArchiveItem[4]%>: </td>
     <td> 
       <input type="text" name="archive_author" maxlength="64" size="30" value="<%=author%>">
     </td>
   </tr>
   <%}%>
   <% if(ArchiveItem[3]!=null && ArchiveItem[3].length()>0) {%>   
   <tr class="bgcolor_title_tr"> 
     <td class="input_title" align="right">&nbsp;<%=ArchiveItem[3]%>: </td>
     <td> 
       <input type="text" name="archive_source" maxlength="64" size="46" value="<%=source%>">
     </td>
   </tr>
   <%}%>
   <tr class="bgcolor_title_tr"> 
     <td class="input_title" align="right">&nbsp;<%=Language.getNameByCode("cms.owner","Owner")%>: </td>
     <td> <input type="text" name="archive_cruser" value="" size="10">
       &nbsp;&nbsp; <%=Language.getNameByCode("cms.hot","Hot")%>  
       <select name="archive_hot">
       	 <option value="-1"><%=Language.getNameByCode("sys.all","all")%></option>
         <option value="1"><%=Language.getNameByCode("sys.true","true")%> </option>
         <option value="0"> ><%=Language.getNameByCode("sys.false","false")%> </option>
       </select>
       &nbsp;&nbsp; <%=Language.getNameByCode("cms.ordernum","OrderNum")%> : 
       <input type="text" name="archive_orderNum" maxlength="12" size="3" value="<%=ordernum%>">
     </td>
   </tr>
   <tr class="bgcolor_title_tr"> 
     <td class="input_title" align="right">&nbsp;</td>
     <td align="right">&nbsp;<%=Language.getNameByCode("sys.Class","Group")%> 
	   		<select name=archive_class size=1>
       	 	<option value="-1"><%=Language.getNameByCode("sys.all","all")%></option>	   		
  	    	<%=Classes.getAllChildrenWithOwnOption(dbi,0,classes)%>
      	</select>
     </td>
   </tr>
   
 </table>
 <input type="submit" name="submit" style="width=80" value="<%=Language.getNameByCode("sys.Submit","Submit")%>">
 <input type="reset" name="rest" style="width=80" value="<%=Language.getNameByCode("sys.Reset","Reset")%>">
 <input type="button" name="close" style="width=80" value="<%=Language.getNameByCode("sys.Close","Close")%> " onClick="self.close();">
 <input type="hidden" name="catid" value="<%=catid%>">
</form>
</body>                
</html>        
<%@ include file="../init_free.jsp" %>        
